package edu.nf.controller.cityroomhotel;

import edu.nf.controller.BaseController;
import edu.nf.hotel.cityroomhotel.CityRoomHotel;
import edu.nf.hotel.cityroomhoteldao.CityRoomHotelDao;
import edu.nf.hotel.cityroomhoteldao.impl.CityRoomHotelDaoImpl;
import edu.nf.hotel.vo.ResultVO;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

import java.util.List;

/**
 * @Date 2023-06-29
 * @Author 带土
 */
public class CityRoomHotelController extends BaseController {

    @RequestMapping("/crh/listName")
    public View getAllNameCRH(@RequestParam("cityName")String cityName){
        CityRoomHotelDao dao = new CityRoomHotelDaoImpl();
        List<CityRoomHotel> list = dao.getAllName(cityName);
        ResultVO<List<CityRoomHotel>> vo = success(list);
        return new JsonView(vo);
    }
}
